package com.example.teststarter.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component  //被 spring 容器管理
@Order(1)   //如果多个自定义的 ApplicationRunner  ，用来标明执行的顺序
public class ApplicationRunnerStartService implements ApplicationRunner {
	
	private static Logger logger =  LoggerFactory.getLogger(ApplicationRunnerStartService.class);
	
	@Override
	public void run(ApplicationArguments args) throws Exception {
		logger.info("===SpringBoot项目启动后，执行ApplicationRunnerStartService方法，进行初始化操作 =============");
	}

}
